﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;


namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class ExportOMailLineReport : OMailLineReport
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.导出 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "OMailLineReport";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (ReportType)
            {
                case 1:
                    DataBind1();
                    break;
                case 2:
                    DataBind2();
                    break;
            }

        }

       
        private void DataBind1()
        {
            DataTableCollection dts = OMailLineController.OMailLine_GetReport1(CreateDateFrom, CreateDateTo);
            this.rpMenu1.DataSource = dts[0];
            this.rpMenu1.DataBind();

            SUMDT1 = dts[1];
            Panel1.Visible = true;
            ExportToExecl("按工位统计NG量报表", this.Panel1);

        }

       
        private void DataBind2()
        {
            DataTableCollection dts = OMailLineController.OMailLine_GetReport2(CreateDateFrom, CreateDateTo);
            this.rpMenu2.DataSource = dts[0];
            this.rpMenu2.DataBind();

            SUMDT2 = dts[1];
            Panel2.Visible = true;
            ExportToExecl("按检查内容统计NG量报表", this.Panel2);

        }
    }
}